/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef PLGLOBAL_H
#define PLGLOBAL_H

#include <kernel/PLAPIConfig.h>
#include <kernel/PLTypes.h>

namespace PLSDK {

	/**
	 * Result for a compare.
	 */
	enum PLCompareResult {
		/**
		 * The object was smaller.
		 */
		PLCompareResultSmaller     = -1,
		/**
		 * The object is the same.
		 */
		PLCompareResultSame        = 0,
		/**
		 * The object was bigger.
		 */
		PLCompareResultBigger      = 1
	};
	
	/**
	 * Swap two values.
	 *
	 * @param value1 First value to swap with the second.
	 * @param value2 The second value.
	 */
	template <typename T>
	inline void plSwap(T &value1, T &value2) {
		const T t = value1;
		value1 = value2;
		value2 = t;
	}

	/**
	 * Macro to disable the unused parameter warning.
	 */
	#define PLUNUSED(x) (void)x;

	/**
	 * Macro to disable the copy functions in a class.
	 */
	#define PLDISABLE_COPY(className) \
		private: \
			className( const className& ); \
			className& operator=( const className& );

}

#endif
